function creatorIterator(arr){
  let i = 0;
  return {
    next(){
      const result = {
       value: arr[i],
       done: arr[i + 1]? false : true
     }
      this.i++
      return  result
  }
  }
  

};
const a = [1,2,3,4,5];
const b = ['a','b','c','d'];

// 我们基于a ,b 赋予迭代
const itera1 = creatorIterator(a);
const itera2 = creatorIterator(b);
